/*Tinymce Init*/

$(function() {
	"use strict";

	tinymce.init({convert_urls: false,
	  selector: '.tinymce',
	  height: 300,
	  plugins: [
		'advlist autolink lists link image charmap print preview anchor',
		'searchreplace visualblocks code fullscreen',
		'insertdatetime media table contextmenu paste code'
	  ],
	  toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
	 
	});
});

var addNotice={
	
	
	//新增公告
	submitNotice:function(){
		var flag = addNotice.validateNotice();
		if(!flag){
					return;
				 }


	},

	//新增验证
	validateNotice : function(){
		var noticeTitle = $("#noticeTitle").val();
        if (noticeTitle == undefined || noticeTitle == "") {
            var nt = $('.form-group');
			nt.addClass('has-error has-danger')
            return false;
        }
        var titleLenth = commonJS.getStringLength(noticeTitle);
        if(titleLenth > 40){
            affirm.show("noticeTip", '提示', '公告标题不能大于20字！', '', '1');
            return false;
        }
	
	}
	


}




